package com.school.movie.common.utils;

import com.school.movie.business.web.model.vo.UserVo;
import org.apache.shiro.SecurityUtils;

/**
 * @author swift
 */
public class ShiroUtil {

    private ShiroUtil() {
    }

    public static UserVo getCurrentUser() {
        return ((UserVo) SecurityUtils.getSubject().getPrincipal());
    }

    public static boolean isLogin() {
        return SecurityUtils.getSubject().getPrincipal() != null;
    }
}
